package com.java8.stream.dome;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Test {

    /**
     * list使用stream，直接判空生成新的list，筛选条件
     */
    public static void master() {
        System.out.println("-----------------Test.master()-----------------");

        List<String> strings = Arrays.asList("悟空", "", "唐僧", "八戒", "悟净", "白龙马");
        List<String> fileded = strings.stream().filter(string -> !string.isEmpty()).collect(Collectors.toList());
        for (String s : fileded) {
            System.out.println(s);
        }
    }
}
